
// This function show/hide element with target selector depending by expression
// show if (expression == true) and hide in other way.
function display(target, expression){
	$(target).css('display', expression ? 'block' : 'none');
}
	
function slide(target, expression, speed){
	expression ? $(target).slideUp(speed) : $(target).slideDown(speed);	// magic from python
}	

// replace element2 by element1
// inverse if (expression == true) 
function replace(element1, element2, expression){
	if(expression){
		$(element1).show();
		$(element2).hide();
	} else {
		$(element2).show();
		$(element1).hide();
	}
}

function select_all_and_submit(){
	$('.stud_in_select option').attr('selected', 'selected');	
	document.forms[0].submit();
}

function move_options(from, to){
	$(from).click(function(){
		$(from + ' option:selected').appendTo(to);
		$(to + ' option:selected').removeAttr('selected');
	});
}

jQuery(document).ready(function() {
	$('.date_input').datepicker ({
		
	});
});
	